home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 180 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.2 KB

  1. Path: engnews1.Eng.Sun.COM!taumet!clamage
  2. From: eddy@siemensrolm.com (eddy Gorsuch)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: Why no allocator-specific delete?
  5. Date: 25 Jan 1996 20:12:13 GMT
  6. Organization: Siemens Rolm Communications Inc.
  7. Approved: clamage@eng.sun.com (comp.std.c++)
  8. Message-ID: <4e8kac$j9h@eclipse.eng.sc.rolm.com>
  9. References: <4dvid8$460@news.bridge.net> <4e0u1s$5fv@engnews1.Eng.Sun.COM>
  10. NNTP-Posting-Host: taumet.eng.sun.com
  11. Content-Type: text
  12. Content-Length: 1496
  13. X-Lines: 33
  14. Originator: clamage@taumet
  15.  
  16. In article <4e0u1s$5fv@engnews1.Eng.Sun.COM>,
  17. Steve Clamage <clamage@Eng.Sun.COM> wrote:
  18. [...]
  19. >No good syntax was found for such. The obvious syntax
  20. >    delete (x) p;
  21. >leads to too many ambiguities. More importantly, it means that the
  22. >point of deletion would somehow have to know what placement version
  23.  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  24. >of "new" was used and what the parameters were. Needing that knowledge
  25. >would make "placement delete" unsafe and hard to use. (Consider the
  26. >general case where the "new" and "delete" expressions are in different
  27. >compilation units, and the parameters to "new" affect how "delete"
  28. >should be called.)
  29. [...]
  30. >>but there is no matching version of 'delete'? Are we supposed to use both 
  31. >>destroy() and deallocate() to get rid of that object?
  32. >
  33. >Yes. In the above example:
  34. >    p->~T();
  35. >    operator delete(p, x);
  36.         ^^^^^^^^^^^^^^^^^^^^^^
  37.  
  38. On the one hand you are saying that a placement syntax would make the point
  39. of deletion know what placement version of new was used, then you show the
  40. proper way to delete an object created with placement new that requires that
  41. same knowledge, but one of your arguments is that this knowledge is bad.
  42.  
  43. eddy
  44. -- 
  45. ed.dy \'ed-e-\ n [ME (Sc dial.) ydy, prob. fr. ON itha; akin to OHG ith- 
  46.    again], L et and 1a: a current of water or air running contrary to the main 
  47.    current; esp)X : a small whirlpool 1b: a substance moving similarly  2: a 
  48.    contrary or circular current  - eddy vb
  49.  
  50. [ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  51.   Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  52.   is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
  53.  
  54.